<!DOCTYPE html>


<html lang="zn-CH">


<head>
  <meta charset="utf-8" />
    
  <meta name="description" content="What I can do is to Do My Personal Best!" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>
    centos7.6 入门操作记录 |  小熊的博客
  </title>
  <meta name="generator" content="hexo-theme-yilia-plus">
  
  <link rel="shortcut icon" href="http://www.cdn.adingxiong.com/b5363a06dc744d79a94021492bcefe27" />
  
  
<link rel="stylesheet" href="/blog/dist/main.css">

  
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/css/remixicon.min.css">

  
<link rel="stylesheet" href="/blog/css/custom.css">

  
  
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>

  
  

  

<link rel="alternate" href="/blog/atom.xml" title="小熊的博客" type="application/atom+xml">
</head>

</html>

<body>
  <div id="app">
    <main class="content on">
      <section class="outer">
  <article id="post-Centos7.6入门操作" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h1 class="article-title sea-center" style="border-left:0" itemprop="name">
  centos7.6 入门操作记录
</h1>
 

    </header>
    

    
    <div class="article-meta">
      <a href="/blog/2020/04/18/Centos7.6%E5%85%A5%E9%97%A8%E6%93%8D%E4%BD%9C/" class="article-date">
  <time datetime="2020-04-18T05:47:36.257Z" itemprop="datePublished">2020-04-18</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/blog/categories/%E8%BF%90%E7%BB%B4/">运维</a>
  </div>

      
      
<div class="word_count">
    <span class="post-time">
        <span class="post-meta-item-icon">
            <i class="ri-quill-pen-line"></i>
            <span class="post-meta-item-text"> Word count:</span>
            <span class="post-count">1k</span>
        </span>
    </span>

    <span class="post-time">
        &nbsp; | &nbsp;
        <span class="post-meta-item-icon">
            <i class="ri-book-open-line"></i>
            <span class="post-meta-item-text"> Reading time≈</span>
            <span class="post-count">4 min</span>
        </span>
    </span>
</div>

      
    </div>
    

    
    
    <div class="tocbot"></div>





    

    
    <div class="article-entry" itemprop="articleBody">
      
      

      
      <h4 id="1-安装VNC远程桌面管理工具"><a href="#1-安装VNC远程桌面管理工具" class="headerlink" title="1. 安装VNC远程桌面管理工具"></a>1. 安装VNC远程桌面管理工具</h4><figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">yum</span> <span class="string">grouplist</span>  </span><br><span class="line"><span class="comment">#安装之</span></span><br><span class="line"><span class="string">yum</span> <span class="string">groupinstall</span> <span class="string">-y</span> <span class="string">"GNOME Desktop"</span></span><br><span class="line"><span class="comment"># 安装完成后，修改默认启动方式为图形化界面</span></span><br><span class="line"><span class="string">systemctl</span> <span class="string">set-default</span> <span class="string">graphical.target</span>  <span class="string">//设置成图形模式</span></span><br><span class="line"><span class="comment"># 如果要换回来</span></span><br><span class="line"><span class="string">systemctl</span> <span class="string">set-default</span> <span class="string">multi-user.target</span>  <span class="string">//设置成命令模式</span></span><br><span class="line"><span class="comment">#然后重启系统即可</span></span><br></pre></td></tr></table></figure>

<h5 id="第一步：安装VNC服务软件，使用root用户执行以下命令（以下操作没有特别说明均在root用户）："><a href="#第一步：安装VNC服务软件，使用root用户执行以下命令（以下操作没有特别说明均在root用户）：" class="headerlink" title="第一步：安装VNC服务软件，使用root用户执行以下命令（以下操作没有特别说明均在root用户）："></a>第一步：安装VNC服务软件，使用root用户执行以下命令（以下操作没有特别说明均在root用户）：</h5><figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 执行下载命令</span></span><br><span class="line"><span class="string">yum</span> <span class="string">install</span> <span class="string">tigervnc-server</span> <span class="string">-y</span></span><br><span class="line"><span class="comment"># 查看是否下载成功</span></span><br><span class="line"><span class="string">rpm</span> <span class="string">-qa|grep</span> <span class="string">tigervnc-server</span></span><br></pre></td></tr></table></figure>




<h5 id="文件上传下载操作"><a href="#文件上传下载操作" class="headerlink" title="文件上传下载操作"></a>文件上传下载操作</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">rz   </span><br><span class="line">#从本地上传文件至服务器</span><br></pre></td></tr></table></figure>


<h5 id="xshell连接远程服务器"><a href="#xshell连接远程服务器" class="headerlink" title="xshell连接远程服务器"></a>xshell连接远程服务器</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">ssh root@192.168.9.52 </span><br><span class="line">#然后输入面    root表示使用什么用户身份访问</span><br></pre></td></tr></table></figure>



<h5 id="Linux基本指令"><a href="#Linux基本指令" class="headerlink" title="Linux基本指令"></a>Linux基本指令</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"># 返回根目录 </span><br><span class="line"> cd &#x2F;</span><br><span class="line"># 创建文件夹</span><br><span class="line">mkdir filename</span><br></pre></td></tr></table></figure>



<h5 id="jdk环境搭建"><a href="#jdk环境搭建" class="headerlink" title="jdk环境搭建"></a>jdk环境搭建</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line"># 查看jdk应用版本</span><br><span class="line">yum -y list java*</span><br><span class="line"># 安装jdk8版本</span><br><span class="line">yum -y install java-1.8.0-openjdk*</span><br><span class="line"># 产看jdk安装路径</span><br><span class="line"> which java</span><br><span class="line"># 查看jre文件位置</span><br><span class="line">ls -lrt &#x2F;usr&#x2F;bin&#x2F;java</span><br><span class="line">ls -lrt &#x2F;etc&#x2F;alternatives&#x2F;java</span><br><span class="line"># 进入jvm文件夹</span><br><span class="line">cd &#x2F;usr&#x2F;lib&#x2F;jvm</span><br><span class="line"># 查看该文件夹下的所有文件</span><br><span class="line">ls</span><br><span class="line"># 编辑profile配置文件 ，添加环境变量</span><br><span class="line">vi &#x2F;etc&#x2F;profile</span><br><span class="line"># 移动到配置文件的最下面 添加如下配置说明</span><br><span class="line">export JAVA_HOME&#x3D;&#x2F;usr&#x2F;local&#x2F;jdk1.8.0_221</span><br><span class="line">export JRE_HOME&#x3D;&#x2F;usr&#x2F;local&#x2F;jdk1.8.0_221&#x2F;jre</span><br><span class="line">export CLASS_PATH&#x3D;.:$JAVA_HOME&#x2F;lib&#x2F;dt.jar:$JAVA_HOME&#x2F;lib&#x2F;tools.jar:$JRE_HOME&#x2F;lib</span><br><span class="line">export PATH&#x3D;$PATH:$JAVA_HOME&#x2F;bin:$JRE_HOME&#x2F;bin</span><br><span class="line"># 按ESC退出编辑模式，并输入：Wq保存并退出</span><br><span class="line"># 输入以下命令 使配置文件生效</span><br><span class="line">source &#x2F;etc&#x2F;profile</span><br><span class="line"># 输入查看命令 检查jdk安装是否成功</span><br><span class="line">java -version</span><br></pre></td></tr></table></figure>

<h5 id="mysql8安装"><a href="#mysql8安装" class="headerlink" title="mysql8安装"></a><code>mysql</code>8安装</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br></pre></td><td class="code"><pre><span class="line">#在指定路径创建文件夹</span><br><span class="line">cd usr&#x2F;local</span><br><span class="line">mkdir mysql</span><br><span class="line">cd mysql</span><br><span class="line"></span><br><span class="line">#检查是否有旧版本或者已经存在mysql</span><br><span class="line">rpm -qa | grep maraidb</span><br><span class="line">rpm -qa | grep mysql</span><br><span class="line"></span><br><span class="line"># 找到如果存在的话进行卸载删除操作</span><br><span class="line">yum remove mysql* </span><br><span class="line">yum remove maraidb 或者  rpm -e XXXXXX --nodeps  </span><br><span class="line"></span><br><span class="line"># 卸载完成之后 开始进行安装下载操作</span><br><span class="line">wget https:&#x2F;&#x2F;dev.mysql.com&#x2F;get&#x2F;Downloads&#x2F;MySQL-8.0&#x2F;mysql-8.0.16-2.el7.x86_64.rpm-bundle.tar </span><br><span class="line">     </span><br><span class="line"># 解压到当前目录</span><br><span class="line">tar -xvf mysql-8.0.16-2.el7.x86_64.rpm-bundle.tar  </span><br><span class="line"># 安装common</span><br><span class="line">rpm -ivh mysql-community-common-8.0.16-2.el7.x86_64.rpm --nodeps --force</span><br><span class="line"></span><br><span class="line"># 安装libs</span><br><span class="line">rpm -ivh mysql-community-libs-8.0.16-2.el7.x86_64.rpm --nodeps --force      </span><br><span class="line"></span><br><span class="line"># 安装client</span><br><span class="line">rpm -ivh mysql-community-client-8.0.16-2.el7.x86_64.rpm --nodeps --force  </span><br><span class="line">#安装server</span><br><span class="line">rpm -ivh mysql-community-server-8.0.16-2.el7.x86_64.rpm --nodeps --force</span><br><span class="line"></span><br><span class="line"># 查看已经安装的mysql安装包</span><br><span class="line">rpm -qa | grep mysql            </span><br><span class="line"></span><br><span class="line"># 初始化mysql</span><br><span class="line">mysqld --initialize;</span><br><span class="line"></span><br><span class="line"># 给文件夹读写权限</span><br><span class="line">chown mysql:mysql &#x2F;var&#x2F;lib&#x2F;mysql -R;</span><br><span class="line"></span><br><span class="line">#启动mysql服务</span><br><span class="line">systemctl start mysqld.service;</span><br><span class="line"></span><br><span class="line">#设置mysql为开机自启</span><br><span class="line">systemctl enable mysqld;</span><br><span class="line"></span><br><span class="line"># 查看初始密码</span><br><span class="line">cat &#x2F;var&#x2F;log&#x2F;mysqld.log | grep password    </span><br><span class="line"></span><br><span class="line"># 使用初始密码登录mysql</span><br><span class="line">mysql -u root -p         </span><br><span class="line"></span><br><span class="line"># 登录后执行该命令，修改密码，重新登录</span><br><span class="line">ALTER USER &#39;root&#39;@&#39;localhost&#39; IDENTIFIED WITH mysql_native_password BY &#39;newPwd&#39;;</span><br><span class="line"></span><br><span class="line"># 创建远程访问帐号</span><br><span class="line">create user &#39;newname&#39;@&#39;%&#39; identified with mysql_native_password by &#39;newpwd&#39;;</span><br><span class="line">   </span><br><span class="line"># 设置数据库的访问权限</span><br><span class="line">grant all privileges on *.* to &#39;NAME&#39;@&#39;%&#39; with grant option;</span><br><span class="line"></span><br><span class="line">flush privileges;</span><br></pre></td></tr></table></figure>
<h4 id="安装数据库中遇到的问题"><a href="#安装数据库中遇到的问题" class="headerlink" title="安装数据库中遇到的问题"></a>安装数据库中遇到的问题</h4><p><img src="https://raw.githubusercontent.com/supbadboy/image/master/img/20191217143112.png" alt><br><img src="https://raw.githubusercontent.com/supbadboy/image/master/img/20191217143158.png" alt></p>
<p>先报这个 <code>Failed to start mysqld.service: Unit not found.</code><br>然后我安装了  <code>mariadb</code>然后报<code>Failed to start mariadb.service: Unit not found.</code></p>
<p>然后去 <code>/etc/init.d/</code>目录 ，未查看到相关安装服务，可能是冲突，然后删除所有mysql相关服务包，重新走上面的流程，完成数据库安装<br><img src="https://raw.githubusercontent.com/supbadboy/image/master/img/20191217143410.png" alt></p>
<p>分配和权限问题 </p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 查询用户拥有的权限</span></span><br><span class="line"><span class="keyword">select</span> host,<span class="keyword">user</span>,grant_priv,super_priv,create_priv,update_priv,delete_priv,select_priv  <span class="keyword">from</span> mysql.user;</span><br><span class="line"><span class="comment"># 给该用户增删查改的权限</span></span><br><span class="line"><span class="keyword">update</span> <span class="keyword">user</span> <span class="keyword">set</span>  grant_priv=<span class="string">'Y'</span>,super_priv=<span class="string">'Y'</span>,create_priv=<span class="string">'Y'</span>,update_priv=<span class="string">'Y'</span>,delete_priv=<span class="string">'Y'</span> <span class="keyword">where</span> <span class="keyword">user</span> =<span class="string">'root'</span></span><br><span class="line"><span class="comment"># 刷新权限 </span></span><br><span class="line"><span class="keyword">flush</span> <span class="keyword">privileges</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment"># 然后重启services mysql restart ;切换用户即可</span></span><br></pre></td></tr></table></figure>

<h3 id="数据的卸载"><a href="#数据的卸载" class="headerlink" title="数据的卸载"></a>数据的卸载</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">1.检查安装的东西</span><br><span class="line"></span><br><span class="line">rpm -qa |grep -i mysql</span><br><span class="line"></span><br><span class="line">2.开始卸载安装的东西</span><br><span class="line"></span><br><span class="line">yum remove 检查到的东西</span><br><span class="line"></span><br><span class="line">3.清理文件</span><br><span class="line"></span><br><span class="line">find &#x2F; -name mysql</span><br><span class="line"></span><br><span class="line">rm -rf 文件</span><br></pre></td></tr></table></figure>






<h4 id="mysql-5-7-安装步骤"><a href="#mysql-5-7-安装步骤" class="headerlink" title="mysql 5.7 安装步骤"></a>mysql 5.7 安装步骤</h4>
      
      <!-- reward -->
      
      <div id="reward-btn">
        Donate
      </div>
      
    </div>
    
    
      <!-- copyright -->
      
        <div class="declare">
          <ul class="post-copyright">
            <li>
              <i class="ri-copyright-line"></i>
              <strong>Copyright： </strong>
              Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
            </li>
          </ul>
        </div>
        
    <footer class="article-footer">
      
          
<div class="share-btn">
      <span class="share-sns share-outer">
        <i class="ri-share-forward-line"></i>
        分享
      </span>
      <div class="share-wrap">
        <i class="arrow"></i>
        <div class="share-icons">
          
          <a class="weibo share-sns" href="javascript:;" data-type="weibo">
            <i class="ri-weibo-fill"></i>
          </a>
          <a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
            <i class="ri-wechat-fill"></i>
          </a>
          <a class="qq share-sns" href="javascript:;" data-type="qq">
            <i class="ri-qq-fill"></i>
          </a>
          <a class="douban share-sns" href="javascript:;" data-type="douban">
            <i class="ri-douban-line"></i>
          </a>
          <!-- <a class="qzone share-sns" href="javascript:;" data-type="qzone">
            <i class="icon icon-qzone"></i>
          </a> -->
          
          <a class="facebook share-sns" href="javascript:;" data-type="facebook">
            <i class="ri-facebook-circle-fill"></i>
          </a>
          <a class="twitter share-sns" href="javascript:;" data-type="twitter">
            <i class="ri-twitter-fill"></i>
          </a>
          <a class="google share-sns" href="javascript:;" data-type="google">
            <i class="ri-google-fill"></i>
          </a>
        </div>
      </div>
</div>

<div class="wx-share-modal">
    <a class="modal-close" href="javascript:;"><i class="ri-close-circle-line"></i></a>
    <p>扫一扫，分享到微信</p>
    <div class="wx-qrcode">
      <img src="//api.qrserver.com/v1/create-qr-code/?size=150x150&data=https://bodboy.gitee.io/blog/2020/04/18/Centos7.6%E5%85%A5%E9%97%A8%E6%93%8D%E4%BD%9C/" alt="微信分享二维码">
    </div>
</div>

<div id="share-mask"></div>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/blog/tags/Linux/" rel="tag">Linux</a></li></ul>


    </footer>

  </div>

  
  
  <nav class="article-nav">
    
      <a href="/blog/2020/04/18/IDEA%E7%A0%B4%E8%A7%A3%E6%95%99%E7%A8%8B%EF%BC%882020.01.08%EF%BC%89/" class="article-nav-link">
        <strong class="article-nav-caption">上一篇</strong>
        <div class="article-nav-title">
          
            IDEA破解
          
        </div>
      </a>
    
    
      <a href="/blog/2020/04/13/PGSQL%E8%AE%A1%E7%AE%97%E6%97%B6%E9%97%B4%E5%B7%AE/" class="article-nav-link">
        <strong class="article-nav-caption">下一篇</strong>
        <div class="article-nav-title">PGSQL计算时间差</div>
      </a>
    
  </nav>


  

  
  
<!-- valine评论 -->
<div id="vcomments-box">
    <div id="vcomments">
    </div>
</div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src='https://cdn.jsdelivr.net/npm/valine@1.3.10/dist/Valine.min.js'></script>
<script>
    new Valine({
        el: '#vcomments',
        app_id: 'uW8QYGvvhWmNWdiwpznJ0GVa-gzGzoHsz',
        app_key: 'LrJhMzx9qEwcMV1DJjTI6f6C',
        path: window.location.pathname,
        notify: 'false',
        verify: 'false',
        avatar: '[object Object]',
        placeholder: '给我的文章加点评论吧~',
        recordIP: true
    });
    const infoEle = document.querySelector('#vcomments .info');
    if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
        infoEle.childNodes.forEach(function (item) {
            item.parentNode.removeChild(item);
        });
    }
</script>
<style>
    #vcomments-box {
        padding: 5px 30px;
    }

    @media screen and (max-width: 800px) {
        #vcomments-box {
            padding: 5px 0px;
        }
    }

    #vcomments-box #vcomments {
        background-color: #fff;
    }

    .v .vlist .vcard .vh {
        padding-right: 20px;
    }

    .v .vlist .vcard {
        padding-left: 10px;
    }
</style>

  

  
  
  
  
  

</article>
</section>
      <footer class="footer">
  <div class="outer">
    <ul>
      <li>
        Copyrights &copy;
        2019-2021
        <i class="ri-heart-fill heart_icon"></i> panda
      </li>
    </ul>
    <ul>
      <li>
        
        
        
        Powered by <a href="https://hexo.io" target="_blank">Hexo</a>
        <span class="division">|</span>
        Theme - <a href="https://github.com/Shen-Yu/hexo-theme-ayer" target="_blank">Ayer</a>
        
      </li>
    </ul>
    <ul>
      <li>
        
        
        <span>
  <span><i class="ri-user-3-fill"></i>Visitors:<span id="busuanzi_value_site_uv"></span></s>
  <span class="division">|</span>
  <span><i class="ri-eye-fill"></i>Views:<span id="busuanzi_value_page_pv"></span></span>
</span>
        
      </li>
    </ul>
    <ul>
      
    </ul>
    <ul>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&amp;web_id=1278069914'></script>
        
      </li>
    </ul>
  </div>
</footer>
      <div class="float_btns">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>

<div class="todark" id="todark">
  <i class="ri-moon-line"></i>
</div>

      </div>
    </main>
    <aside class="sidebar on">
      <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/blog/"><img src="https://portrait.gitee.com/uploads/avatars/user/1007/3023420_bodboy_1578973210.png!avatar200" alt="小熊的博客"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/blog/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/blog/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/blog/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/blog/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/blog/tags/%E6%97%85%E8%A1%8C/">旅行</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/blog/about">关于我</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="Search">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/blog/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
    </aside>
    <script>
      if (window.matchMedia("(max-width: 768px)").matches) {
        document.querySelector('.content').classList.remove('on');
        document.querySelector('.sidebar').classList.remove('on');
      }
    </script>
    <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="/blog/images/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="/blog/images/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
    
<script src="/blog/js/jquery-2.0.3.min.js"></script>


<script src="/blog/js/lazyload.min.js"></script>


<script>
  try {
    var typed = new Typed("#subtitle", {
      strings: ['面朝大海，春暖花开', '愿你一生努力，一生被爱', '想要的都拥有，得不到的都释怀'],
      startDelay: 0,
      typeSpeed: 200,
      loop: true,
      backSpeed: 100,
      showCursor: true
    });
  } catch (err) {
  }

</script>




<script src="/blog/js/tocbot.min.js"></script>

<script>
  // Tocbot_v4.7.0  http://tscanlin.github.io/tocbot/
  tocbot.init({
    tocSelector: '.tocbot',
    contentSelector: '.article-entry',
    headingSelector: 'h1, h2, h3, h4, h5, h6',
    hasInnerContainers: true,
    scrollSmooth: true,
    scrollContainer: 'main',
    positionFixedSelector: '.tocbot',
    positionFixedClass: 'is-position-fixed',
    fixedSidebarOffset: 'auto'
  });
</script>



<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css">
<script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js"></script>

<script src="/blog/dist/main.js"></script>



<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.min.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script>


<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
      tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
  });

  MathJax.Hub.Queue(function() {
      var all = MathJax.Hub.getAllJax(), i;
      for(i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
      }
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.6/unpacked/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script>
  var ayerConfig = {
    mathjax: true
  }
</script>




<script src="/blog/js/busuanzi-2.3.pure.min.js"></script>



<script type="text/javascript" src="https://js.users.51.la/20544303.js"></script>

  
<script src="/blog/js/clickLove.js"></script>



<!-- 复制 -->



    
    <div id="music">
    
    
    
    <iframe frameborder="no" border="1" marginwidth="0" marginheight="0" width="200" height="52"
        src="//music.163.com/outchain/player?type=2&id=1297802566&auto=1&height=32"></iframe>
</div>

<style>
    #music {
        position: fixed;
        right: 15px;
        bottom: 0;
        z-index: 998;
    }
</style>
    
  </div>
</body>

</html>